package org.ouwa.lms.client.support.event;

/**
 * Serves as a parent for all application level events.
 * It holds the {@link ApplicationEventSource source} that triggered the event
 * and enforces each event implementation to provide an appropriate description for the event.
 * 
 * @author lviet
 */
public abstract class ApplicationEvent {
	protected ApplicationEventSource source;
	
	/**
     * Constructs a new AppliationEvent which is triggered by
     * the given {@link ApplicationEventSource source}.
     * @param source The {@link ApplicationEventSource source} that triggers this event.
     */
	public ApplicationEvent(ApplicationEventSource source) {
		this.source = source;
	}
	
	/**
     * Returns the {@link ApplicationEventSource source} that triggered this event.
     * @return The {@link ApplicationEventSource source} that triggered this event.
     */
	public ApplicationEventSource getSource() {
		return source;
	}
	
	 /**
     * Returns the description of this event.
     * This can be a dynamic description that changes between event instances of
     * the same type.
     * @return The description of this event.
     */
    public abstract String getDescription();
}
